
package com.hexinfo.dmpro.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hexinfo.dmpro.admin.dao.SysDeptMapper;
import com.hexinfo.dmpro.admin.model.SysDict;
import com.hexinfo.dmpro.admin.dao.SysDictMapper;
import com.hexinfo.dmpro.admin.model.SysDictDetail;
import liquibase.pro.packaged.S;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 字典表
 *
 * @author zhouax
 * @date 2023-08-10 19:33:55
 */
@Service
public class SysDictService extends ServiceImpl<SysDictMapper, SysDict> {

    @Autowired
    private SysDictMapper sysDictMapper;

    public Page queryList(Page page, SysDict sysDict) {
        LambdaQueryWrapper<SysDict> wrapper = Wrappers.lambdaQuery();
        wrapper.select();
        Page returnPage = this.baseMapper.selectPage(page, wrapper);
        return returnPage;
    }

    /**
     * 按字典名获取子字典列表
     * @return
     */
    public List<SysDictDetail> dictDetail(String dictName) {
        List<SysDictDetail> sys = sysDictMapper.dictDetail(dictName);
        return sys;
    }
}
